#include "mkvmuxfilter.hpp"

namespace MkvMux
{

InpinAudio::InpinAudio(Filter* p) : Inpin(p, L"audio")
{
}


InpinAudio::~InpinAudio()
{
}


HRESULT InpinAudio::QueryAccept(const AM_MEDIA_TYPE*)
{
    return S_FALSE;  //TODO
}


HRESULT InpinAudio::GetAllocatorRequirements(ALLOCATOR_PROPERTIES* p)
{
    if (p == 0)
        return E_POINTER;
        
    //TODO
    
    ALLOCATOR_PROPERTIES& props = *p;
    
    props.cBuffers = 1;  //?
    props.cbBuffer = 0;  //?
    props.cbAlign = 0;   //?
    props.cbPrefix = 0;
    
    return S_OK;
}


HRESULT InpinAudio::OnReceiveConnection(IPin*, const AM_MEDIA_TYPE&)
{
    return E_FAIL;  //TODO
}


HRESULT InpinAudio::OnReceive(IMediaSample* pSample)
{
    if (pSample == 0)  //EOS
        return S_OK;  //TODO
        
    if (pSample->IsPreroll() == S_OK)
        return S_OK;  //TODO: what does this mean for audio?
        
    return S_OK;  //TODO
}

} //end namespace MkvMux
